package com.walter.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.walter.entity.Dict;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 字典表(目前支持父子二级) Mapper 接口
 * </p>
 *
 * @author ch
 * @since 2021-05-25
 */
public interface DictMapper extends BaseMapper<Dict> {
    List<Dict> find(Pagination pagination, Map map);

    @Select("select * from sys_dict where code = #{param1}")
    Dict findByCode(String code);

    @Select("select * from sys_dict where code = #{code} and id <> #{id}")
    Dict findByCodeAndId(@Param("code") String code, @Param("id") Integer id);
}
